<?php
final class Error
{
    public static function trigger($code, $isShowMag=false)
    {
        if ($isShowMag)
        {
            die(self::parse($code));
        }
        die("Error:#{$code}");
    }
    public static function parse($code)
    {
        return @self::$errors[$code];
    }
    private static $errors = array();
    public static function pack(array $errors, $isOverwrite=false)
    {
        self::$errors = $isOverwrite? array_merge(self::$errors, $errors): self::$errors+$errors;
    }
}
ErrorManager::pack(array(
    'NO_CONFIG_PATH'=>'找不到設定檔目錄',
));